package org.code.mallspringboot.service.impl;

import org.code.mallspringboot.mapper.MemberMapper;
import org.code.mallspringboot.pojo.UmsMember;
import org.code.mallspringboot.service.MemberService;
import org.code.mallspringboot.vo.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

@Service
public class MemberServiceImpl implements MemberService , UserDetailsService {

    @Autowired
    private MemberMapper memberMapper;

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {

        UmsMember umsMember = memberMapper.loadUserByUsername(username);
        if (umsMember != null){
            //权限
        }
        return umsMember;
    }
}
